package n03;

public class N05 { //身份证
	public N05(String id) {//通过身份证号来构造方法
		if(id.length()!=18)throw new RuntimeException("身份证长度错误~");
		if(id.substring(0, 4).equals("4101"))throw new RuntimeException("不是郑州市身份证~");
		if("05,06".indexOf(id.substring(4, 6))==-1)throw new RuntimeException("郑州编码错误~");
		
	}
	public static void main(String[] args) {
		try {
			N05 id1 = new N05("4101052000051000256");
			System.out.println("ok~");
		}catch(Exception e) {
			System.out.println(e.getMessage());
		}
	}
}
